<%@ page import="okhttp3.OkHttpClient" %>
<%@ page import="okhttp3.MediaType" %>
<%@ page import="okhttp3.RequestBody" %>
<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="okhttp3.Request" %>
<%@ page import="okhttp3.Response" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %><%

    out.println("TEST START.");
    OkHttpClient client = new OkHttpClient();
    MediaType mediaType = MediaType.parse("application/json");
    Map<String, Object> paramMap = new HashMap<>();
    paramMap.put("SN", "TEST001");

    List<Map<String, String>> mapList = new ArrayList<>();
    Map<String, String> map = new HashMap<>();
    map.put("pin", "cs001");
    mapList.add(map);
    paramMap.put("Data", mapList);
    out.println("paramMap:" + JSONObject.toJSONString(paramMap));
    RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(paramMap));
    Request requestT = new Request.Builder()
            .url("http://192.168.0.68:1820/Face/delUser")
            .post(body)
            .addHeader("Content-Type", "application/json")
            .build();
    try {
        Response responseT = client.newCall(requestT).execute();
        out.println(responseT.body().string());
    } catch (Exception e) {
        out.println("Exception occurred when httpClient:" + e.getMessage());
    }
%>